import {
	defineStore
} from 'pinia';

const useStore = defineStore('appUI', {
	state: () => {
		return {
			containerScrollTop: 0,
			headerHidden: true,
			headerLocked: false,
			headerNotPlace: true
		}
	},
	getters: {
		
	},
	actions: {
		changeContainerScrollTop(top) {
			this.containerScrollTop = top;
		},
		lockHeader() {
			this.headerLocked = true;
		},
		freeHeader() {
			this.headerLocked = false;
		},
		showHeader() {
			if (this.headerLocked) return;
			this.headerHidden = false;
			this.headerNotPlace = false;
		},
		hideHeader(notPlace = false) {
			if (this.headerLocked) return;
			this.headerHidden = true;
			this.headerNotPlace = notPlace;
		}
	},
	// persist: {
	// 	enabled: true,
	// 	strategies: [{
	// 		storage: localStorage,
	// 		// paths: []
	// 	}]
	// }
})

export default useStore;